package com.gf.forcesystem.mq.weatherparse;

import com.gf.forcesystem.model.dto.weather.AbstractWeather;
import com.gf.forcesystem.model.dto.weather.Fog;
import org.springframework.stereotype.Service;

import java.nio.ByteBuffer;

/**
 * @author gaofei
 * @date 2022/6/24 21:30
 */
@Service("FogParse")
public class FogParse implements IWeatherParse{
    @Override
    public byte identifier() {
        return (byte) 0xC5;
    }

    @Override
    public AbstractWeather parse(ByteBuffer byteBuffer) {
        Fog fog = new Fog();
        fog.setType(byteBuffer.getShort());
        return fog;
    }
}
